/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package rad.Java.MotelPlus.Class;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import rad.Java.Common.Class.DefaultClass;
import rad.Java.Common.Class.IClass;


/**
 *
/* @author Renato ferreira dos santos
 */
public class Block extends DefaultClass implements IClass{
    // <editor-fold defaultstate="collapsed" desc="Declaration of variables">
        private String _name;
        private String _floor_number;
    //</editor-fold>

    public Block()
    {
        _gsql.setTable("block");
        _sequence = "block_block_id_seq";
    }

    // <editor-fold defaultstate="collapsed" desc="Declaration of methods Get and Set">
        public String getName() {
            return _name;
        }

        public void setName(String _name) {
            this._name = _name;
        }

        public String getFloor_number() {
            return _floor_number;
        }

        public void setFloor_number(String _floor_number) {
            this._floor_number = _floor_number;
        }

    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Declaration of functions">

        public void clear() {
            _id             = "";
            _name           = "";
            _floor_number   = "";
        }

        @Override
        public void get(ResultSet rs) {
            try {
                _id             = rs.getString("block_id");
                _name           = rs.getString("block_name");
                _floor_number   = rs.getString("block_floor_number");
            } catch (SQLException ex) {
                Logger.getLogger(Block.class.getName()).log(Level.SEVERE, null, ex);
            }
        }

        @Override
        public void setGsql() {
            _gsql.setValue( _id              ,"block_id");
            _gsql.setValue( _name            ,"block_name");
            _gsql.setValue( _floor_number    ,"block_floor_number");
        }
    // </editor-fold>
}
